#define _CRT_SECURE_NO_WARNINGS 1
#include <stdio.h>

//int main() {
//    int x = 0XABCD;
//    do {
//        printf("%o", x % 16);
//    } while (x /= 16);
//}

//int f(int n) {
//    int s = 0;
//    while (n > 0) { s += (n % 10) * (n % 10), n /= 10; }
//    return s;
//}
//int main() {
//    int k = 1234567;
//    while (k > 100)k = f(k);
//    printf("%d", k);
//}

//#include<stdio.h>
//int main() {
//	int x = 100, y = 200, z = 300;
//	if (x > y)z = x, x = y; y = z;
//	printf("x=%d,y=%d,z=%d", x, y, z);
//}

//int f(int x) {
//    if (x < 3) return x + 1;
//    else    return 3 * f(x - 1) + 2 * f(x - 2);
//}
//int main()
//{
//    printf("%d", f(5));
//}


/*
int xsqare(int x)
{
	int ret = 1;
	while (x)
	{
		ret *= 19;
		x--;
	}
	return ret;
}

int _bit(int num)
{
	int ret = 0;
	while (xsqare(ret) <= num)
	{
		ret++;
	}
	return ret;
}

void to19(int num)
{
	char _num[] = { '0','1','2','3','4','5','6','7','8','9', 'A' , 'B' , 'C' , 'D' , 'E' , 'F', 'G', 'H', 'I' };
	
	int bit = _bit(num);
	
	while (bit)
	{
		int i = num / xsqare(bit - 1);
		printf("%c", _num[i]);
		num -= i * xsqare(bit - 1);
		bit--;
	}
}

void to10(int num)
{
	int n = 0;
	int k = 0;
	while (num)
	{
		n += num % 10 * xsqare(k++);		
		num /= 10;
	}
	printf("%d", n);
}

int main()
{
	int x = 0, y = 0;
	scanf("%d %d", & x, & y);

	switch (x)
	{
	case 10:
		to19(y);
		break;
	case 19:
		to10(y);
		break;
	default:
		printf("DATA ERROR!");
		break;
	}
	return 0;
}*/

